#include <iostream>
#include <string>
#include <deque>
#include <iterator>
#include <algorithm>
using namespace std;
typedef struct HTNode{
   unsigned int weight;
   string s;
   HTNode *lchild,*rchild;
}HTNode,*HTp;
bool cmp(HTNode *a,HTNode *b)
{
	return (*a).weight<(*b).weight;
}
int tras(HTNode &h,string s)
{
	string ss=s;
	if(h.lchild==NULL&&h.rchild==NULL)
	{
		h.s=s;
		return 0;
	}
	if(h.lchild!=NULL)
	{
		ss=s+'0';
		tras(*(h.lchild),ss);
	}
	if(h.rchild!=NULL)
	{
		ss=s+'1';
		tras(*(h.rchild),ss);
	}
}
int main()
{
	deque<HTNode> l;
	deque<HTp> p;
   int i,n;
   string s="";
   HTNode a;
   HTNode *pp;
   cin>>n;
   for(i=0;i<n;i++)
   {
		cin>>a.weight;
		a.lchild=NULL;a.rchild=NULL;
		l.push_back(a);
		pp=&l.back();
		p.push_back(pp);
   }
   i=0;
   while(p.begin()+i<p.end()-1)
   {
		sort(p.begin()+i,p.end(),cmp);
		a.lchild=p[i];a.rchild=p[i+1];
		a.weight=(*p[i]).weight+(*p[i+1]).weight;
		l.push_back(a);
		pp=&l.back();
		p.push_back(pp);
		i+=2;
   }
   i=p.size()-1;
   tras(*p[i],s);
   for(i=0;i<n;i++)cout<<l[i].s<<endl;
   return 0;
}//main
